// admin/system/model/sys_dept.go
package model

import (
	"time"
)

// SysDept 部门表
type SysDept struct {
	DeptID     int64      `json:"dept_id" gorm:"column:dept_id;primaryKey;autoIncrement;comment:部门id"`
	ParentID   int64      `json:"parent_id" gorm:"column:parent_id;default:0;comment:父部门id"`
	Ancestors  string     `json:"ancestors" gorm:"column:ancestors;size:50;default:'';comment:祖级列表"`
	DeptName   string     `json:"dept_name" gorm:"column:dept_name;size:30;default:'';comment:部门名称"`
	OrderNum   int        `json:"order_num" gorm:"column:order_num;default:0;comment:显示顺序"`
	Leader     *string    `json:"leader,omitempty" gorm:"column:leader;size:20;comment:负责人"`
	Phone      *string    `json:"phone,omitempty" gorm:"column:phone;size:11;comment:联系电话"`
	Email      *string    `json:"email,omitempty" gorm:"column:email;size:50;comment:邮箱"`
	Status     string     `json:"status" gorm:"column:status;size:1;default:'0';comment:部门状态（0正常 1停用）"`
	DelFlag    string     `json:"del_flag" gorm:"column:del_flag;size:1;default:'0';comment:删除标志（0代表存在 2代表删除）"`
	CreateBy   string     `json:"create_by" gorm:"column:create_by;size:64;default:'';comment:创建者"`
	CreateTime *time.Time `json:"create_time,omitempty" gorm:"column:create_time;comment:创建时间"`
	UpdateBy   string     `json:"update_by" gorm:"column:update_by;size:64;default:'';comment:更新者"`
	UpdateTime *time.Time `json:"update_time,omitempty" gorm:"column:update_time;comment:更新时间"`
}

// TableName 获取表名
func (SysDept) TableName() string {
	return "sys_dept"
}
